import React, { Component } from 'react'
import './iconfont.css'
import { func, string } from 'prop-types'

class MyIcon extends Component {
  render() {
    const { type, onClick } = this.props
    return (
      <>
        <span className={'iconfont ' + type} onClick={onClick}></span>
      </>
    )
  }
}

MyIcon.propTypes = {
  type: string.isRequired,
  onClick: func
}

MyIcon.defaultProps = {
  onClick: () => {}
}

export default MyIcon
